package cn.webrx;

import java.util.HashMap;

public class HashMap1 {
    public static void main(String[] args) {
        HashMap<String,User> hm = new HashMap<>();
        hm.put("s1",new User(22,"李四",20));
        hm.put("s2",new User(13,"李四",20));
        hm.put("s3",new User(15,"李四",20));
        hm.putIfAbsent("s4",new User(16,"李四",20));

        //hm.clear();
        System.out.println(hm.size());

        System.out.println(hm.containsKey("s1"));
        System.out.println(hm.containsValue(new User(22,"李四",20)));

        System.out.println(hm);

        //Map<String,Object> map = new HashMap<String, Object>();
        //List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
    }
}
